package com.muyu.product.service.impl;

import java.util.List;

import com.muyu.common.core.utils.ObjUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import com.muyu.product.mapper.AsCategoryBrandMapper;
import com.muyu.product.domain.AsCategoryBrand;
import com.muyu.product.service.AsCategoryBrandService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

/**
 * 品类品牌中间Service业务层处理
 *
 * @author DongZeLiang
 * @date 2024-02-27
 */
@Slf4j
@Service
public class AsCategoryBrandServiceImpl extends ServiceImpl<AsCategoryBrandMapper, AsCategoryBrand>  implements AsCategoryBrandService {

    /**
     * 查询品类品牌中间列表
     *
     * @param asCategoryBrand 品类品牌中间
     * @return 品类品牌中间
     */
    @Override
    public List<AsCategoryBrand> list(AsCategoryBrand asCategoryBrand) {
        LambdaQueryWrapper<AsCategoryBrand> queryWrapper = new LambdaQueryWrapper<>();


        if (ObjUtils.notNull(asCategoryBrand.getCategoryId())){
            queryWrapper.eq(AsCategoryBrand::getCategoryId, asCategoryBrand.getCategoryId());
        }

        if (ObjUtils.notNull(asCategoryBrand.getBrandId())){
            queryWrapper.eq(AsCategoryBrand::getBrandId, asCategoryBrand.getBrandId());
        }





        return list(queryWrapper);
    }
}
